package com.scy.service.impl;

import com.scy.dao.ArticleDao;
import com.scy.pojo.TArticle;
import com.scy.service.ArticleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
import org.springframework.stereotype.Service;

/**
 * @author 司晨雨
 * @date 2020/6/19 20:28
 * @description
 */
@Service
public class ArticleServiceImpl implements ArticleService {

    @Autowired
    private ArticleDao articleDao;

    public Page<TArticle> findAllByPage(Integer pageNum,Integer pageSize) {
        Page<TArticle> articles = articleDao.findAll(PageRequest.of(pageNum, pageSize));
        return articles;
    }
}
